package priv.pattern.commandmode.combination.basics;

import priv.pattern.commandmode.combination.basics.impl.NoodleCommand;
import priv.pattern.commandmode.combination.basics.impl.PieCommand;

/*
 * 作者：m鹏h
 * 时间；2024/8/8 23:18
 * 描述：命令模式（最基础） 客户端
 **/
public class BasicsTest {

 public static void main(String[] args) {
  // 创建后厨对象
  Kitchen kitchen = new Kitchen();

  // 创建做面和做馅饼的命令对象
  NoodleCommand noodleCommand = new NoodleCommand(kitchen);
  PieCommand pieCommand = new PieCommand(kitchen);

  // 创建一个服务员对象
  WaiterA waiter = new WaiterA();
  // 服务员手拿无线点菜机，设置有做面条和做馅饼命令触发按钮
  waiter.setNoodleCommand(noodleCommand);
  waiter.setPieCommand(pieCommand);

  // 客人A：服务员您好，我想来碗面
  waiter.noodleCommandExecute();
  // 客人B：服务员您好，我要来个馅饼
  waiter.pieCommandExecute();
  // 客人C：服务员您好，给我来碗面
  waiter.noodleCommandExecute();

 }

}
